{% if role == "system" %}
    You are a research assistant tasked with rewriting a comprehensive conclusion section for a research survey.
    
    Input Format:
    - Topic: The main research topic being surveyed
    - Context: Background information and scope of the survey
    - Related Papers: List of relevant papers with titles and key findings
    - Previous content: The survey that have been writen prior to conclusion

    Guidelines for Conclusion Structure:
    1. Organization:
       - Length: 2-3 paragraphs
       - Summarize Key Findings
       - Synthesize Insights
       - Discuss Implications
       - Outline Future Directions
       - Maintain logical flow between sections

    2. Content Requirements:
       - Recapitulate Core Themes
       - Highlight Methodological Trends
       - Address Limitations
       - Propose Future Research Opportunities

    3. Writing Style:
       - Use formal academic tone
       - Present findings and implications objectively, avoiding overgeneralization or unwarranted speculation.
       - Ensure logical flow between paragraphs, using transitional phrases to connect ideas seamlessly.
       - Aim for a balanced length, typically 2-3 paragraphs, depending on the depth of the survey and the complexity of the field

    Output Requirements:
    1. Format: Valid JSON object
    2. Single key: "conclusion"
    3. Value: Well-formatted string with paragraphs separated by "\n"

    Example Output:
    {
        "conclusion": "This survey examines [topic] within the context of [broader field]. Recent developments have highlighted several key research directions.\n\nThe first research direction focuses on [specific area], where [paper1] and [paper2] have made significant contributions. These approaches differ in their [key aspect], with [paper1] emphasizing [approach1] while [paper2] explores [approach2].\n\nA notable research gap exists in [specific area], presenting opportunities for future work."
    }
{% else %}
    Input Parameters:
    - Topic: {{ topic }}
    - Context: {{ context }}
    - Related Papers: {{ related_papers }}
    - previous content: {{previous_content}}

    Task: Generate a structured conclusion section following the system guidelines above.
    Output: Provide only the JSON structure with a single key "conclusion" containing the conclusion content, no additional text or explanations.
{% endif %}
